<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Heart Rate Service</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51822 BLE SDK
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__ble__sdk__srv__hrs.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Heart Rate Service</div>  </div>
<div class="ingroups"><a class="el" href="group__ble__sdk__srv.html">Bluetooth Services</a></div></div>
<div class="contents">

<p>Heart Rate Service module.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__hrs__evt__t.html">ble_hrs_evt_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Heart Rate Service event.  <a href="structble__hrs__evt__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__hrs__init__t.html">ble_hrs_init_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Heart Rate Service init structure. This contains all options and data needed for initialization of the service.  <a href="structble__hrs__init__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__hrs__s.html">ble_hrs_s</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Heart Rate Service structure. This contains various status information for the service.  <a href="structble__hrs__s.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga31b5866ba8e305a1b7ca2fb60db7b326"></a><!-- doxytag: member="ble_sdk_srv_hrs::BLE_HRS_BODY_SENSOR_LOCATION_OTHER" ref="ga31b5866ba8e305a1b7ca2fb60db7b326" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BLE_HRS_BODY_SENSOR_LOCATION_OTHER</b>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5425d93ca774106500b41705e15055b4"></a><!-- doxytag: member="ble_sdk_srv_hrs::BLE_HRS_BODY_SENSOR_LOCATION_CHEST" ref="ga5425d93ca774106500b41705e15055b4" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BLE_HRS_BODY_SENSOR_LOCATION_CHEST</b>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga17a151b89da0050f4777588290c4aedb"></a><!-- doxytag: member="ble_sdk_srv_hrs::BLE_HRS_BODY_SENSOR_LOCATION_WRIST" ref="ga17a151b89da0050f4777588290c4aedb" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BLE_HRS_BODY_SENSOR_LOCATION_WRIST</b>&#160;&#160;&#160;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3cc553f76ed3ea59fabb38c628562b0d"></a><!-- doxytag: member="ble_sdk_srv_hrs::BLE_HRS_BODY_SENSOR_LOCATION_FINGER" ref="ga3cc553f76ed3ea59fabb38c628562b0d" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BLE_HRS_BODY_SENSOR_LOCATION_FINGER</b>&#160;&#160;&#160;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafd74436f71c3e8398e86837787e3c2a5"></a><!-- doxytag: member="ble_sdk_srv_hrs::BLE_HRS_BODY_SENSOR_LOCATION_HAND" ref="gafd74436f71c3e8398e86837787e3c2a5" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BLE_HRS_BODY_SENSOR_LOCATION_HAND</b>&#160;&#160;&#160;4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga950b269e5a74ec5b830e99f7b7919e52"></a><!-- doxytag: member="ble_sdk_srv_hrs::BLE_HRS_BODY_SENSOR_LOCATION_EAR_LOBE" ref="ga950b269e5a74ec5b830e99f7b7919e52" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BLE_HRS_BODY_SENSOR_LOCATION_EAR_LOBE</b>&#160;&#160;&#160;5</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga63bef70c28133016a9735ffdbc732df9"></a><!-- doxytag: member="ble_sdk_srv_hrs::BLE_HRS_BODY_SENSOR_LOCATION_FOOT" ref="ga63bef70c28133016a9735ffdbc732df9" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BLE_HRS_BODY_SENSOR_LOCATION_FOOT</b>&#160;&#160;&#160;6</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#ga2e829f32fd9d57d18d1e8daa7956dee5">BLE_HRS_MAX_BUFFERED_RR_INTERVALS</a>&#160;&#160;&#160;20</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafea0cb34e3a05260b4de67d81f2f4cab"></a><!-- doxytag: member="ble_sdk_srv_hrs::ble_hrs_t" ref="gafea0cb34e3a05260b4de67d81f2f4cab" args="" -->
typedef struct <a class="el" href="structble__hrs__s.html">ble_hrs_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Heart Rate Service structure. This contains various status information for the service. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga85836949ab0f55e7ffcaec72dd0ee6e1"></a><!-- doxytag: member="ble_sdk_srv_hrs::ble_hrs_evt_handler_t" ref="ga85836949ab0f55e7ffcaec72dd0ee6e1" args=")(ble_hrs_t *p_hrs, ble_hrs_evt_t *p_evt)" -->
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#ga85836949ab0f55e7ffcaec72dd0ee6e1">ble_hrs_evt_handler_t</a> )(<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, <a class="el" href="structble__hrs__evt__t.html">ble_hrs_evt_t</a> *p_evt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Heart Rate Service event handler type. <br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gaee495052c855cd5345f7301b594763c9">ble_hrs_evt_type_t</a> { <a class="el" href="group__ble__sdk__srv__hrs.html#ggaee495052c855cd5345f7301b594763c9a0f13cf6877038b174544d95ee3a40894">BLE_HRS_EVT_NOTIFICATION_ENABLED</a>, 
<a class="el" href="group__ble__sdk__srv__hrs.html#ggaee495052c855cd5345f7301b594763c9a1ed0b327eecae450aa039af15ddae345">BLE_HRS_EVT_NOTIFICATION_DISABLED</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Heart Rate Service event type.  <a href="group__ble__sdk__srv__hrs.html#gaee495052c855cd5345f7301b594763c9">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#ga94256c7eb29129ff352ca53adf1ad5b8">ble_hrs_init</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, const <a class="el" href="structble__hrs__init__t.html">ble_hrs_init_t</a> *p_hrs_init)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the Heart Rate Service.  <a href="#ga94256c7eb29129ff352ca53adf1ad5b8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gac50e029608199cc8d52463acb3e8a02e">ble_hrs_on_ble_evt</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, <a class="el" href="structble__evt__t.html">ble_evt_t</a> *p_ble_evt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Heart Rate Service BLE stack event handler.  <a href="#gac50e029608199cc8d52463acb3e8a02e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gabe5fed48baeb4a518a51bd7e2e5f010e">ble_hrs_heart_rate_measurement_send</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, uint16_t heart_rate)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends heart rate measurement if notification has been enabled.  <a href="#gabe5fed48baeb4a518a51bd7e2e5f010e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gaea316a9c9503571b143d93086295f61a">ble_hrs_rr_interval_add</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, uint16_t rr_interval)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a RR Interval measurement to the RR Interval buffer.  <a href="#gaea316a9c9503571b143d93086295f61a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gaf207a34d16fbee25b5555fd4192b5b15">ble_hrs_rr_interval_buffer_is_full</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if RR Interval buffer is full.  <a href="#gaf207a34d16fbee25b5555fd4192b5b15"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gad8b66aa54ddf79459271df6ec9b65644">ble_hrs_sensor_contact_supported_set</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, bool is_sensor_contact_supported)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the state of the Sensor Contact Supported bit.  <a href="#gad8b66aa54ddf79459271df6ec9b65644"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#ga4eccea2cb1d248ccdc75bebb84c1dff2">ble_hrs_sensor_contact_detected_update</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, bool is_sensor_contact_detected)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the state of the Sensor Contact Detected bit.  <a href="#ga4eccea2cb1d248ccdc75bebb84c1dff2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__hrs.html#gab3ec66c7419f5c79ad54f849353e8aea">ble_hrs_body_sensor_location_set</a> (<a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *p_hrs, uint8_t body_sensor_location)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the Body Sensor Location.  <a href="#gab3ec66c7419f5c79ad54f849353e8aea"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Heart Rate Service module. </p>
<p>This module implements the Heart Rate Service with the Heart Rate Measurement, Body Sensor Location and Heart Rate Control Point characteristics. During initialization it adds the Heart Rate Service and Heart Rate Measurement characteristic to the BLE stack database. Optionally it also adds the Body Sensor Location and Heart Rate Control Point characteristics.</p>
<p>If enabled, notification of the Heart Rate Measurement characteristic is performed when the application calls <a class="el" href="group__ble__sdk__srv__hrs.html#gabe5fed48baeb4a518a51bd7e2e5f010e" title="Sends heart rate measurement if notification has been enabled.">ble_hrs_heart_rate_measurement_send()</a>.</p>
<p>The Heart Rate Service also provides a set of functions for manipulating the various fields in the Heart Rate Measurement characteristic, as well as setting the Body Sensor Location characteristic value.</p>
<p>If an event handler is supplied by the application, the Heart Rate Service will generate Heart Rate Service events to the application.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The application must propagate BLE stack events to the Heart Rate Service module by calling <a class="el" href="group__ble__sdk__srv__hrs.html#gac50e029608199cc8d52463acb3e8a02e" title="Heart Rate Service BLE stack event handler.">ble_hrs_on_ble_evt()</a> from the from the <a class="el" href="group__ble__stack__handler.html">BLE Stack Event Handler</a> callback. </dd></dl>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga2e829f32fd9d57d18d1e8daa7956dee5"></a><!-- doxytag: member="ble_hrs.h::BLE_HRS_MAX_BUFFERED_RR_INTERVALS" ref="ga2e829f32fd9d57d18d1e8daa7956dee5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BLE_HRS_MAX_BUFFERED_RR_INTERVALS&#160;&#160;&#160;20</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Size of RR Interval buffer inside service. </p>

<p>Definition at line <a class="el" href="ble__hrs_8h_source.html#l00058">58</a> of file <a class="el" href="ble__hrs_8h_source.html">ble_hrs.h</a>.</p>

</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="gaee495052c855cd5345f7301b594763c9"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_evt_type_t" ref="gaee495052c855cd5345f7301b594763c9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__ble__sdk__srv__hrs.html#gaee495052c855cd5345f7301b594763c9">ble_hrs_evt_type_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Heart Rate Service event type. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="ggaee495052c855cd5345f7301b594763c9a0f13cf6877038b174544d95ee3a40894"></a><!-- doxytag: member="BLE_HRS_EVT_NOTIFICATION_ENABLED" ref="ggaee495052c855cd5345f7301b594763c9a0f13cf6877038b174544d95ee3a40894" args="" -->BLE_HRS_EVT_NOTIFICATION_ENABLED</em>&nbsp;</td><td>
<p>Heart Rate value notification enabled event. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggaee495052c855cd5345f7301b594763c9a1ed0b327eecae450aa039af15ddae345"></a><!-- doxytag: member="BLE_HRS_EVT_NOTIFICATION_DISABLED" ref="ggaee495052c855cd5345f7301b594763c9a1ed0b327eecae450aa039af15ddae345" args="" -->BLE_HRS_EVT_NOTIFICATION_DISABLED</em>&nbsp;</td><td>
<p>Heart Rate value notification disabled event. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="ble__hrs_8h_source.html#l00061">61</a> of file <a class="el" href="ble__hrs_8h_source.html">ble_hrs.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga94256c7eb29129ff352ca53adf1ad5b8"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_init" ref="ga94256c7eb29129ff352ca53adf1ad5b8" args="(ble_hrs_t *p_hrs, const ble_hrs_init_t *p_hrs_init)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_hrs_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structble__hrs__init__t.html">ble_hrs_init_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs_init</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the Heart Rate Service. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. This structure will have to be supplied by the application. It will be initialized by this function, and will later be used to identify this particular service instance. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs_init</td><td>Information needed to initialize the service. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on successful initialization of service, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00252">252</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
<a class="anchor" id="gac50e029608199cc8d52463acb3e8a02e"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_on_ble_evt" ref="gac50e029608199cc8d52463acb3e8a02e" args="(ble_hrs_t *p_hrs, ble_evt_t *p_ble_evt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_hrs_on_ble_evt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structble__evt__t.html">ble_evt_t</a> *&#160;</td>
          <td class="paramname"><em>p_ble_evt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Heart Rate Service BLE stack event handler. </p>
<p>Handles all events from the BLE stack of interest to the Heart Rate Service.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ble_evt</td><td>Event received from the BLE stack. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00084">84</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
<a class="anchor" id="gabe5fed48baeb4a518a51bd7e2e5f010e"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_heart_rate_measurement_send" ref="gabe5fed48baeb4a518a51bd7e2e5f010e" args="(ble_hrs_t *p_hrs, uint16_t heart_rate)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_hrs_heart_rate_measurement_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>heart_rate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sends heart rate measurement if notification has been enabled. </p>
<p>The application calls this function after having performed a heart rate measurement. If notification has been enabled, the heart rate measurement data is encoded and sent to the client.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">heart_rate</td><td>New heart rate measurement. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">include_expended_energy</td><td>Determines if expended energy will be included in the heart rate measurement data. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on success, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00294">294</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
<a class="anchor" id="gaea316a9c9503571b143d93086295f61a"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_rr_interval_add" ref="gaea316a9c9503571b143d93086295f61a" args="(ble_hrs_t *p_hrs, uint16_t rr_interval)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_hrs_rr_interval_add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>rr_interval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Adds a RR Interval measurement to the RR Interval buffer. </p>
<p>All buffered RR Interval measurements will be included in the next heart rate measurement message, up to the maximum number of measurements that will fit into the message. If the buffer is full, the oldest measurement in the buffer will be deleted.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rr_interval</td><td>New RR Interval measurement (will be buffered until the next transmission of Heart Rate Measurement). </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00332">332</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
<a class="anchor" id="gaf207a34d16fbee25b5555fd4192b5b15"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_rr_interval_buffer_is_full" ref="gaf207a34d16fbee25b5555fd4192b5b15" args="(ble_hrs_t *p_hrs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ble_hrs_rr_interval_buffer_is_full </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if RR Interval buffer is full. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if RR Interval buffer is full, false otherwise. </dd></dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00348">348</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
<a class="anchor" id="gad8b66aa54ddf79459271df6ec9b65644"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_sensor_contact_supported_set" ref="gad8b66aa54ddf79459271df6ec9b65644" args="(ble_hrs_t *p_hrs, bool is_sensor_contact_supported)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_hrs_sensor_contact_supported_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>is_sensor_contact_supported</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the state of the Sensor Contact Supported bit. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">is_sensor_contact_supported</td><td>New state of the Sensor Contact Supported bit. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on success, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00354">354</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga4eccea2cb1d248ccdc75bebb84c1dff2"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_sensor_contact_detected_update" ref="ga4eccea2cb1d248ccdc75bebb84c1dff2" args="(ble_hrs_t *p_hrs, bool is_sensor_contact_detected)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_hrs_sensor_contact_detected_update </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>is_sensor_contact_detected</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the state of the Sensor Contact Detected bit. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">is_sensor_contact_detected</td><td>TRUE if sensor contact is detected, FALSE otherwise. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00369">369</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
<a class="anchor" id="gab3ec66c7419f5c79ad54f849353e8aea"></a><!-- doxytag: member="ble_hrs.h::ble_hrs_body_sensor_location_set" ref="gab3ec66c7419f5c79ad54f849353e8aea" args="(ble_hrs_t *p_hrs, uint8_t body_sensor_location)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_hrs_body_sensor_location_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__hrs.html#gafea0cb34e3a05260b4de67d81f2f4cab">ble_hrs_t</a> *&#160;</td>
          <td class="paramname"><em>p_hrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>body_sensor_location</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the Body Sensor Location. </p>
<p>Sets a new value of the Body Sensor Location characteristic. The new value will be sent to the client the next time the client reads the Body Sensor Location characteristic.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_hrs</td><td>Heart Rate Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">body_sensor_location</td><td>New Body Sensor Location. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on success, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__hrs_8c_source.html#l00375">375</a> of file <a class="el" href="ble__hrs_8c_source.html">ble_hrs.c</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
